﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NovUceci.aspx.cs" Inherits="Sio.Mdm.Web.Organizacija.NovUceci" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>SIO - MDM :: Organizacija : Nov učeči</title>
    <style type="text/css">
        .fieldspace
        {
            padding: 0 10px 10px 0;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    <ext:Store runat="server" ID="StorePoste">
        <Reader>
            <ext:JsonReader IDProperty="PostaId">
                <Fields>
                    <ext:RecordField Name="PostaId" Type="Int" />
                    <ext:RecordField Name="PostnaStevilka" Type="Int" />
                    <ext:RecordField Name="Naziv" Type="String" />
                    <ext:RecordField Name="StevilkaNaziv" Type="String">
                        <Convert Handler="return record.PostnaStevilka+' '+record.Naziv;" />
                    </ext:RecordField>
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store runat="server" ID="StoreSolskaLeta">
        <Reader>
            <ext:JsonReader IDProperty="LetoId">
                <Fields>
                    <ext:RecordField Name="LetoId" Type="Int" />
                    <ext:RecordField Name="Naziv" Type="String" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store runat="server" ID="StoreRazredi" OnRefreshData="StoreRazrediRefresh" AutoLoad="false">
        <Reader>
            <ext:JsonReader IDProperty="RazredId">
                <Fields>
                    <ext:RecordField Name="RazredId" Type="Int" />
                    <ext:RecordField Name="Razred" Type="String" />
                    <ext:RecordField Name="Paralelka" Type="String" />
                    <ext:RecordField Name="Oznaka" Type="String" />
                    <ext:RecordField Name="RazredParalelka" Type="String">
                        <Convert Handler="return record.Razred+'.'+record.Paralelka;" />
                    </ext:RecordField>
                </Fields>
            </ext:JsonReader>
        </Reader>
        <Listeners>
            <Load Handler="#{cbRazredi}.setValue(#{cbRazredi}.store.getAt(0).get('razredId'));" />
        </Listeners>
    </ext:Store>
    <ext:Viewport ID="Viewport1" runat="server" Layout="Fit">
        <Content>
            <sio:FormPanel runat="server" ID="addUceci" Layout="border" MonitorPoll="500" MonitorValid="true">
                <Items>
                    <ext:FieldSet ID="FieldSet1" runat="server" Region="Center" Title="Osnovni podatki"
                        AutoHeight="true" Margins="5 5 0 5" Padding="15">
                        <Items>
                            <ext:Panel runat="server" Border="false" BodyStyle="background: none;">
                                <Content>
                                    <ext:TableLayout ID="TableLayout1" runat="server" Columns="3">
                                        <Cells>
                                            <ext:Cell CellCls="fieldspace">
                                                <ext:TextField ID="inputIme" runat="server" LabelAlign="Top" FieldLabel="Ime" AnchorHorizontal="95%"
                                                    Width="100" AllowBlank="false" MinLength="2" MinLengthText="Vpišite ime" BlankText="Vpišite ime" />
                                            </ext:Cell>
                                        </Cells>
                                        <Cells>
                                            <ext:Cell CellCls="fieldspace">
                                                <ext:TextField ID="inputPriimek" runat="server" LabelAlign="Top" FieldLabel="Priimek"
                                                    AnchorHorizontal="95%" Width="100" AllowBlank="false" MinLength="2" MinLengthText="Vpišite priimek"
                                                    BlankText="Vpišite priimek" />
                                            </ext:Cell>
                                        </Cells>
                                        <Cells>
                                            <ext:Cell CellCls="fieldspace">
                                                <ext:ComboBox ID="cbSpol" SelectedIndex="0" FieldLabel="Spol" LabelAlign="Top" runat="server"
                                                    Editable="false" SelectOnFocus="true" Width="100">
                                                    <Items>
                                                        <ext:ListItem Text="moški" Value="0" />
                                                        <ext:ListItem Text="ženski" Value="1" />
                                                    </Items>
                                                </ext:ComboBox>
                                            </ext:Cell>
                                        </Cells>
                                    </ext:TableLayout>
                                </Content>
                            </ext:Panel>
                            <ext:Panel ID="PanelPosta" runat="server" Border="false" BodyStyle="background: none;">
                                <Content>
                                    <ext:TableLayout ID="TableLayout5" runat="server" Columns="1">
                                        <Cells>
                                            <ext:Cell CellCls="fieldspace">
                                                <ext:TextField ID="inputNaslov" runat="server" LabelAlign="Top" FieldLabel="Naslov"
                                                    AnchorHorizontal="95%" Width="320" AllowBlank="false" MinLength="2" MinLengthText="Vpišite naslov"
                                                    BlankText="Vpišite naslov" />
                                            </ext:Cell>
                                            <ext:Cell CellCls="fieldspace">
                                                <ext:ComboBox ID="cbPoste" runat="server" StoreID="StorePoste" Editable="false" LabelAlign="Top"
                                                    FieldLabel="Pošta" DisplayField="StevilkaNaziv" ValueField="PostaId" TypeAhead="true"
                                                    Width="320" Mode="Local" ForceSelection="true" EmptyText="Izberi pošto..." Resizable="false"
                                                    SelectOnFocus="true" AutoHeight="true" />
                                            </ext:Cell>
                                        </Cells>
                                    </ext:TableLayout>
                                </Content>
                            </ext:Panel>
                            <ext:Panel ID="PanelStevilke" runat="server" Border="false" BodyStyle="background: none;">
                                <Content>
                                    <ext:TableLayout ID="TableLayout2" runat="server" Columns="2">
                                        <Cells>
                                            <ext:Cell CellCls="fieldspace">
                                                <ext:NumberField ID="inputEmso" runat="server" LabelAlign="Top" FieldLabel="EMŠO"
                                                    AnchorHorizontal="95%" Width="120" AllowBlank="false" MinLength="13" MaxLength="13"
                                                    MinLengthText="Vpišite EMŠO" BlankText="Vpišite EMŠO" />
                                            </ext:Cell>
                                        </Cells>
                                        <Cells>
                                            <ext:Cell CellCls="fieldspace">
                                                <ext:NumberField ID="inputDs" runat="server" LabelAlign="Top" FieldLabel="Davčna številka"
                                                    AnchorHorizontal="95%" Width="100" AllowBlank="false" MinLength="8" MaxLength="8"
                                                    MinLengthText="Vpišite davčno številko" BlankText="Vpišite davčno številko" />
                                            </ext:Cell>
                                        </Cells>
                                    </ext:TableLayout>
                                </Content>
                            </ext:Panel>
                        </Items>
                    </ext:FieldSet>
                    <ext:FieldSet ID="FieldSet2" runat="server" Region="East" Title="Podatki učečega"
                        AutoHeight="true" Width="150" Margins="5 5 0 5">
                        <Items>
                            <ext:TableLayout ID="TableLayout3" runat="server" Columns="1">
                                <Cells>
                                    <ext:Cell CellCls="fieldspace">
                                        <ext:ComboBox ID="cbSolskoLeto" StoreID="StoreSolskaLeta" DisplayField="Naziv" ValueField="LetoId"
                                            FieldLabel="Šolsko leto" LabelAlign="Top" runat="server" Editable="false" SelectOnFocus="true"
                                            Width="90">
                                            <Listeners>
                                                <Select Handler="#{cbRazredi}.clearValue(); #{StoreRazredi}.reload();" />
                                            </Listeners>
                                        </ext:ComboBox>
                                    </ext:Cell>
                                    <ext:Cell CellCls="fieldspace">
                                        <ext:ComboBox ID="cbRazredi" StoreID="StoreRazredi" DisplayField="RazredParalelka"
                                            ValueField="RazredId" FieldLabel="Razred" LabelAlign="Top" runat="server" Editable="false"
                                            SelectOnFocus="true" Width="90" />
                                    </ext:Cell>
                                    <ext:Cell CellCls="fieldspace">
                                        <ext:Checkbox runat="server" ID="chkUstvari" FieldLabel="Ustvari uporabniški račun" />
                                    </ext:Cell>
                                </Cells>
                            </ext:TableLayout>
                        </Items>
                    </ext:FieldSet>
                </Items>
                <Listeners>
                    <ClientValidation Handler="#{AddUceciProxy}.disableButton('Save', !valid);" />
                </Listeners>
            </sio:FormPanel>
        </Content>
    </ext:Viewport>
    <sio:DialogProxy runat="server" ID="AddUceciProxy" WindowId="AddUceci">
        <DirectEvents>
            <ButtonClicked OnEvent="AddUceciButton">
            </ButtonClicked>
        </DirectEvents>
    </sio:DialogProxy>
    </form>
</body>
</html>
